
function setCookie(name, val, day) {
  var oDate = new Date();
  oDate.setDate(oDate.getDate() + day);
  document.cookie = `${name}=${val}; expires=${oDate}`;
}

function getCookie(name){
  var cookies = document.cookie.split('; ');

  for(let i=0;i<cookies.length;i++){
    let arr = cookies[i].split('=');
    if(arr[0] == name){
      return arr[1]
    }
    return ''
  }
}

function deleteCookie(name){
  setCookie(name, 1, -1);
}



